package com.xujiang.mytool.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.xujiang.common_adapter.base.IBaseAdapter;
import com.xujiang.common_core.util.mlog.L;
import com.xujiang.mytool.model.DirAndFileName;

import java.util.List;

/**
 * @author xujiang
 * @version 2017-07-10 16:19
 */
public class FileAdapter extends MainDeviceListAdapterDelegate<DirAndFileName,WOMainDeviceListViewHolder> {

    public FileAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    protected RecyclerView.ViewHolder onCreateMainDeviceListViewHolder(View view) {
        setOnItemClickListener(new IBaseAdapter.OnItemClickListener<DirAndFileName>(){

            @Override
            public void onItemClick(DirAndFileName item, View view, int position) {
                L.getToast().showLog(getContext(),"点击事件测试");
            }
        });
        return new WOMainDeviceListViewHolder(view);
    }

    @Override
    public void onBindViewHolderItem(WOMainDeviceListViewHolder holder, DirAndFileName item, int position) {
        super.onBindViewHolderItem(holder, item, position);
    }

    @Override
    public boolean isForViewType(@NonNull DirAndFileName item, List<DirAndFileName> items, int position) {
        return true;
    }
}
